Electronic device, control method for an electronic device, and recording medium

ABSTRACT

An electronic device that supports multiple command systems embodies a function for switching from one to another of the multiple command systems regardless of the specifications of the command system being used. A hybrid device  10  that operates based on commands sent from a host computer  200  sets a specific transition condition for changing to another command system after the last command system change corresponding to a switching command sent from the host computer  200 . When the set transition condition is met, the computer returns to the command system used before the command system was last changed or changes to another command system.

BACKGROUND

1. Technical Field

The present invention relates to an electronic device that operatesaccording to commands sent from a computer, a control method for theelectronic device, and a recording medium on which instructions forexecuting the control method are carried.

2. Related Art

Various types of printers and other electronic devices can be connectedto a host computer such as a personal computer, and the command languageused by the host computer to control such electronic devices typicallydiffers according to the model or type of device. It is alsoincreasingly common for plural host computers to share a singleelectronic device, such as when plural host computers and pluralprinters are connected to a network. Normally, the command system of thecommands output by each host computer match the requirements of thespecific electronic device being addressed. In this type of networkedenvironment, however, a connected electronic device may not becompatible with the command system used by the host computer, and thecommand system must be changed on the host computer side. JapaneseUnexamined Patent Appl. Pub. JP-A-H08-123639 therefore teaches anelectronic device that supports a plurality of command systems and canswitch between command languages as instructed by the host computer.

The command systems used by the host computer according to the relatedart may include command systems that do not enable the electronic devicebeing controlled to switch between plural command languages. When thehost computer switches to such a command system, the host computercannot output a command causing the electronic device to change toanother command system. Switching to another command system musttherefore be done on the electronic device side. This requires operatorintervention to manually change the command system by, for example,turning the electronic device off, resetting a particular switch, andthen turning the power on again. This switching operation is bothbothersome and error-prone. More specifically, when a conventionalcommand system that does not define a function for switching to adifferent command system is used, switching to another command systemcannot be done easily.

SUMMARY

An electronic device according to the invention supports multiplecommand systems including a conventional command system that does nothave a defined function for switching to another command system, and canrender a function for switching to another command system regardless ofthe specifications of the command system used.

A first aspect of the invention is directed to an electronic deviceconfigured to communicate with (e.g., by connecting to) a host computer.The electronic device comprises a storage unit that stores at least afirst command system and a second command system; a transition conditionconfiguration unit that sets a specific transition condition forchanging from the second command system to the first command system; anda command control unit that changes from operating in the second commandsystem to operating in the first command system when the transitioncondition set by the transition condition configuration unit issatisfied.

When a defined transition condition is satisfied while executingcommands in one command system, this aspect of the invention enableschanging to executing in another command system. For example, theelectronic device can change to another command system (first commandsystem) when the electronic device is using a command system (secondcommand system) that does not have a command defined for switching to adifferent command system. A function for changing to another commandsystem can therefore be achieved regardless of the specifications of thecommand system being executed.

In another aspect of the invention, the first command system iscompatible with a switching command; and the command control unitchanges to the second command system when the switching command isreceived from the host computer while the command control unit isoperating in the first command system.

This aspect of the invention enables changing from a first commandsystem that has a switching command defined for switching to anothercommand system to a second command system, which does not have a commanddefined for switching to another command system, by a switching command.When the set transition condition is met while operating in the secondcommand system, the command system changes back to the first commandsystem. It is therefore possible to return to the first command systemeven when the second command system does not have a command forswitching to another command system.

In another aspect of the invention, the specific transition condition iscontained in the switching command.

This aspect of the invention enables setting a transition condition forchanging to the next command system simultaneously to changing thecommand system of the electronic device by a switching command receivedfrom the host computer. It is therefore easy to configure changing toanother command system after the electronic device changes to a specificcommand system and completes a specific operation, for example, withoutreceiving a separate command for setting the transition condition fromthe host computer.

In another aspect of the invention, the storage unit stores, in additionto the first and second command systems, a third command system; and acondition for changing operation of the command control unit from thethird command system to the second command system or vice versa is setin the transition condition configuration unit or is contained in theswitching command.

In addition to using a transition condition configuration unit, thisaspect of the invention enables changing the command system of theelectronic device and simultaneously setting another command system tobe changed to by a switching command received from the host computer.

In another aspect of the invention, the first command system is thenative command system of the electronic device; and the second commandsystem is a command system that emulates the command system of anotherelectronic device.

This aspect of the invention enables changing from the original commandsystem of the electronic device to a command system for emulatinganother electronic device, and then returning to the original commandsystem of the electronic device that was previously used when thetransition condition is satisfied even if a switching command is notdefined in the command system for emulating the other electronic device.It is therefore possible to return to the original command system of theelectronic device even after changing the command system to emulate theoperation of another electronic device that is not compatible with aswitching command. Compatibility with the original command system of theelectronic device can therefore be maintained while also being able toemulate another electronic device and return to the native commandsystem of the original electronic device from the emulated commandsystem, and convenience can be assured.

In another aspect of the invention, the first command system is acommand system that is compatible with the switching command, and thesecond command system is a command system that is not compatible withthe switching command.

When the electronic device changes from the command system compatiblewith the switching command to the command system not compatible with theswitching command, a transition condition can be set and changing to theother command system triggered by satisfaction of the transitioncondition is possible even though the command system that is notcompatible with the switching command cannot change to another commandsystem. A function for switching to another command system can thereforebe maintained regardless of the specifications of the command systembeing used.

In another aspect of the invention, the electronic device furthercomprises a first process unit and a second process unit. The firstcommand system is the command system of the first process unit, and thesecond command system is the command system of the second process unit;and the command control unit determines if a command received from thehost computer is a command for the first process unit or a command forthe second process unit, and changes to the command system of the firstprocess unit if the received command is determined to be a command forthe first process unit.

When the electronic device is a hybrid device that has a first processunit and a second process unit that use different command systems, thisaspect of the invention enables changing to the command system of thefirst process unit when a command received from the host computer isdetermined to be a command from the command system of the first processunit while operating in the command system of the second process unit,which is not compatible with a switching command for changing to anothercommand system.

In addition, because the command system used can be changed according towhether the first process unit or second process unit is used, thecommand system appropriate to the process unit can be enabled and used.

In another aspect of the invention, the electronic device furthercomprises a print unit that prints on a processed medium, and an opticalreading unit that optically reads the processed medium. The commandsystem for the first process unit is either a command system forcontrolling the print unit or a command system for controlling theoptical reading unit, and the command system for the second process unitis the other of the command system for controlling the print unit andthe command system for controlling the optical reading unit.

When the electronic device is rendered as a hybrid device having a printunit and an optical reading unit that use different command systems,this aspect of the invention can change the command system usedaccording to whether the command received from the host computer is forthe print unit or the optical reading unit, and thus enables switchingto the command system appropriate to the function used. Because theelectronic device can also change to another command system even whenthe command system used by the print unit or the optical reading unitdoes not contain a switching command for changing to another commandsystem, convenience can be assured regardless of the command systemspecifications.

In another aspect of the invention, the transition conditionconfiguration unit sets as a transition condition a condition at leastone of: a group including passage of a specific time in the secondcommand system, completing execution of all commands received from thehost computer, and completing execution of one command received from thehost computer.

This aspect of the invention can reliably maintain a function forswitching to another command system irrespective of the specificationsof the command system being used because changing to another commandsystem can be reliably triggered by any one of a group of eventsincluding at least passage of a specific time after changing the commandsystem, completing execution of all received commands, and completingexecution of one received command. Other events that can be similarlyused include the receive buffer that stores received commands becomingcleared of all commands to be executed, or execution of a line feed orform feed command when the electronic device has a print unit, forexample.

Another aspect of the invention is directed to a control method for anelectronic device that is configured to communicate with a host computerand store at least a first command system and a second command system.The method comprises the steps of: setting a specific transitioncondition for changing from the second command system to the firstcommand system; and changing operation of a control unit of theelectronic device from the second command system to the first commandsystem when the transition condition set by the transition conditionconfiguration unit is satisfied.

By executing the control method according to this aspect of theinvention, this aspect of the invention enables changing to anothercommand system when a defined transition condition is met whileexecuting commands in one command system. For example, the electronicdevice can change to another command system (first command system) whenthe electronic device is using a command system (second command system)that does not have a command defined for switching to a differentcommand system. A function for changing to another command system cantherefore be achieved regardless of the specifications of the commandsystem being executed.

Still another aspect of the invention entails a storage medium thatstores a program for execution by a control unit to control parts of anelectronic device configured to communicate with a host computer andalso stores at least a first command system and a second command system.The program comprises instructions for: setting a specific transitioncondition for changing from the second command system to the firstcommand system; and changing operation of a control unit of theelectronic device from the second command system to the first commandsystem when the transition condition set by the transition conditionconfiguration unit is satisfied.

As a result of the control unit executing the program stored on astorage medium according to this aspect of the invention, this aspect ofthe invention enables changing to another command system when a definedtransition condition is met while executing commands in one commandsystem. For example, the electronic device can change to another commandsystem (first command system) when the electronic device is using acommand system (second command system) that does not have a commanddefined for switching to a different command system. A function forchanging to another command system can therefore be achieved regardlessof the specifications of the command system being executed.

One effect of the invention is that an electronic device according tothe invention can change to a different command system even while usinga command system that does not have a switching command defined forchanging to a different command system, and can therefore maintain afunction for changing to a different command system regardless of thespecifications of the command system being used.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is an external oblique view of a hybrid device according to apreferred embodiment of the invention.

FIG. 2 is an oblique view of the main assembly of the hybrid device.

FIG. 3 is a side section view of the main assembly.

FIG. 4 is a block diagram of the control system of the hybrid device.

FIG. 5 is a block diagram showing the functional configuration of thehost computer and hybrid device.

FIG. 6 is a flowchart showing an example of hybrid device operation.

FIG. 7 is a flow chart describing switching the operating mode of thehybrid device.

DESCRIPTION OF EMBODIMENTS

A preferred embodiment of the present invention is described below withreference to the accompanying figures.

FIG. 1 is a front oblique view showing the appearance of a hybrid deviceaccording to a preferred embodiment of the invention. FIG. 2 is anexternal oblique view of the main assembly 11. FIG. 3 is a side sectionview of the hybrid device 10 in FIG. 1.

The hybrid device 10 shown in FIG. 1 has a printer function for printingon the recording medium S (processed medium) by a serial impact dotmatrix (SIDM) recording head 18 ((see FIG. 3); an MICR (magnetic inkcharacter recognition) function or reading characters recorded withmagnetic ink on the recording medium S; an MSR (magnetic stripe reader)function for reading and writing information recorded on a magneticstripe disposed to the recording medium S; and a scanner function foroptically scanning both sides of the recording medium S by an opticalreader 110 (see FIG. 3).

Cut-sheet media that is precut to a certain length, and continuous mediahaving numerous sheets connected in a continuous web, are examples ofrecording media S (media) that can be used in the hybrid device 10.Cut-sheet media include, for example, single slips and multipart forms,passbooks, postcards, and letters. Continuous media include continuousmultipart form paper and perforated fanfold paper. In this embodiment ofthe invention checks and promissory notes (collectively referred toherein as simply checks) issued on a bank account, for example, andpassbooks issued by a bank or other financial institution, are used asthe recording medium S.

Checks are slips on which MICR (magnetic ink character recognition)information containing the user's account number and a serial checknumber, for example, are printed in a MICR area MA on the front of thecheck. A passbook is a bound booklet of plural blank pages that can beprinted on when the passbook is open. A magnetic stripe is typicallyrenderedon the outside surface of one of the passbook covers.

Note that of the four sides of a rectangular recording medium S, theedge on the side that is inserted to the hybrid device 10 is referred toherein as the leading edge or end, and the edge on the opposite end asthe leading end is referred to as the trailing edge or end.

As shown in FIG. 1, the hybrid device 10 has a top cover 12, a top case13, and a bottom case 14 as outside case members, and a manual insertionopening 15 in the front of the top case 13 and bottom case 14 where therecording medium S is inserted and discharged. A paper exit 20 fromwhich the recording medium S may be discharged is also formed at theback of the top case 13 and bottom case 14. Whether the recording mediumS processed by the hybrid device 10 is discharged from the manualinsertion opening 15 or the paper exit 20 is controlled by a commandsent to the hybrid device 10 from the host computer 200 described below.

The side where the manual insertion opening 15 is rendered, that is, theleft side as seen in FIG. 3, is referred to herein as the front, and theside where the paper exit 20 is rendered, that is, the right side inFIG. 3, is referred as the rear or back.

As shown in FIG. 2, the hybrid device 10 has a main assembly 11 that iscovered by the foregoing case members. The main assembly 11 includes abottom chassis part 11A and a top chassis part (not shown in the figure)that is supported by pins 11C at the back of the bottom chassis part11A. The top chassis part can pivot by operating a lever (not shown inthe figure) disposed on the left side of the top chassis part, and theinside of the main assembly 11 is exposed when the top chassis partpivots open.

As shown in FIG. 2 and FIG. 3, the main assembly 11 includes a baseframe 16 and a right side frame 17A and left side frame 17B pairattached to the sides of the base frame 16. The side frames (not shownin the figure) of the top case chassis part are disposed on the outsideof the side frames 17A and 17B with a carriage guide shaft 31 spanningtherebetween and a flat front media guide 24 and rear media guide 25affixed between the side frames 17A and 17B. A flat platen 21 isdisposed between the front media guide 24 and rear media guide 25, andthe recording head 18 is disposed above the platen 21 facing the platen21.

The recording head 18 is mounted on a carriage 19 that is fit freelyslidably on the carriage guide shaft 31. The carriage 19 is driventhrough an intervening timing belt (not shown in the figure) by theforward or reverse rotation of a carriage drive motor 56 (FIG. 4) thatdrives the carriage 19, and the carriage 19 thus moves reciprocallyguided by the carriage guide shaft 31. The carriage 19 scansbidirectionally between the side frames of the top chassis part in thedirection indicated by arrow X in FIG. 1, that is, in the main scanningdirection aligned with the axial direction of the carriage guide shaft31 and the long side of the platen 21. Note that the directionperpendicular to the main scanning direction X of the carriage 19, thatis, the direction indicated by arrow Y in FIG. 1, is the secondaryscanning direction.

While the recording head 18 carried on the carriage 19 travels in themain scanning direction with the carriage 19, recording wires are pushedout from the wire face (not shown in the figure) on the distal end ofthe recording head 18 opposite the platen 21 to strike the ink ribbonand transfer ink from the ink ribbon to the recording medium S conveyedbetween the platen 21 and the recording head 18, and record an image,which may include text, on the recording medium S. The ink ribbon isstored folded inside a ribbon cartridge (not shown in the figure) thatis mounted on the main frame or the carriage 19, and is delivered to therecording head 18 while the carriage 19 scans the recording medium. Asshown in FIG. 3, a media width sensor 55 is disposed behind therecording head 18 at a position above the platen 21. The media widthsensor 55 is mounted on the carriage 19 and travels with the carriage 19over the platen 21, and is used to determine the positions of the sideedges of the recording medium S and the width of the recording medium S.

As shown in FIG. 2 and FIG. 3, the platen 21 is flat and extends in thescanning direction of the carriage 19, and is flexibly supported andurged toward the recording head 18 by an urging spring 180. The urgingspring 180 is a compression spring, and the striking force of therecording wires during the recording operation of the recording head 18is assisted by the urging force of the urging spring 180. When thethickness of the recording medium S varies while the recording medium Sis conveyed, or when recording media S of different thicknesses areconveyed to the main assembly 11, the platen 21 is pushed by the distalend of the recording head 18 in resistance to the urging force of theurging spring 180 and moves away from the recording head 18. As aresult, the gap between the distal end of the recording head 18 and therecording surface of the recording medium S is held constant regardlessof the thickness of the recording medium.

As shown in FIG. 3, the printer assembly 11 includes a media conveyancemechanism 100 that conveys the recording medium S, an alignmentmechanism 28 that contacts the leading end of the recording medium Sconveyed by the media conveyance mechanism 100 and aligns the recordingmedium S, a magnetic data reading unit 29 having a magnetic head 34 thatreads the MICR information printed on a check or reads or writesmagnetic information in the magnetic stripe on a passbook, and a mediapressure unit 30 that pushes down on the recording medium S to preventthe recording medium S from lifting up during magnetic informationprocessing, including when the magnetic head 34 of the magnetic datareading unit 29 reads the MICR information.

As shown in FIG. 2 and FIG. 3, the media conveyance mechanism 100includes the platen 21, a first drive roller 22A, a first followerroller 22B, a second drive roller 23A, a second follower roller 23B, athird drive roller 124A, a third follower roller 124B, the front mediaguide 24, the rear media guide 25, a media conveyance motor 26, and adrive wheel train 27. The media conveyance mechanism 100 renders aconveyance path P through which the recording medium S is conveyed overthe front media guide 24 and rear media guide 25. The tops of the frontmedia guide 24 and rear media guide 25 are conveyance surface PA of theconveyance path P.

In this embodiment of the invention the first drive roller 22A and firstfollower roller 22B are disposed on the front side of the printerassembly 11 relative to the platen 21 and recording head 18, and thesecond drive roller 23A and second follower roller 23B pair, and thirddrive roller 124A and third follower roller 124B pair, are disposedsequentially on the rear side of the printer assembly 11 relative to theplaten 21 and recording head 18.

The first drive roller 22A and first follower roller 22B are disposed asa roller pair one above the other, the second drive roller 23A andsecond follower roller 23B are disposed as a roller pair one above theother, and the third drive roller 124A and third follower roller 124Bare disposed as a roller pair one above the other.

The first drive roller 22A, second drive roller 23A, and third driveroller 124A are drive rollers that are driven rotationally by the mediaconveyance motor 26 and drive wheel train 27. The f irst follower roller22B, second follower roller 23B, and third follower roller 124B arefollower rollers that are urged by springs 42A, 42B, and 42C withspecific pressure to the first drive roller 22A, second drive roller23A, and third drive roller 124A side, respectively. As a result, thefirst drive roller 22A and first follower roller 22B are rotationallydriven in mutually opposite directions, the second drive roller 23A andsecond follower roller 23B are rotationally driven in mutually oppositedirections, and the third drive roller 124A and third follower roller124B are rotationally driven in mutually opposite directions.

The drive wheel train 27 is disposed on the outside of the right sideframe 17A as shown in FIG. 2. The drive wheel train 27 has a motorpinion 51 that is affixed to rotate in unison with the drive shaft ofthe media conveyance motor 26, which can rotate in forward and reversedirections. Drive power from the motor pinion 51 is transferred througha speed reducing gear 52 to a second drive gear 53B affixed to thesecond roller shaft 33 of the second drive roller 23A, and istransferred from this second drive gear 53B through an intermediate gear54 to a first drive gear 53A affixed to the first roller shaft 32 of thefirst drive roller 22A.

Torque from the second roller shaft 33 of the second drive roller 23A istransferred to the third roller shaft 134 of the third drive roller 124Aby a drive belt (not shown in the figure), for example. As a result, thefirst drive roller 22A, second drive roller 23A, and third drive roller124A shown in FIG. 3 rotate in the same direction and can convey therecording medium S in the printer assembly 11. More specifically, whenthe media conveyance motor 26 rotates forward, the first drive roller22A, second drive roller 23A, and third drive roller 124A shown in FIG.3 convey the recording medium S in the secondary scanning direction Yinside the printer assembly 11 as denoted by arrow A in the figure, andconvey the recording medium S in the direction in which it is dischargedfrom the printer assembly 11 as indicated by arrow B in the figure whenthe media conveyance motor 26 turns in reverse.

The alignment mechanism 28 aligns the recording medium S before therecording head 18 prints on the recording medium S and before theoptical reader 110 scans the recording medium S. The alignment mechanism28 includes plural alignment plates 38 and an alignment plate motor (seeFIG. 4) that drives the alignment plates 38. The alignment plates 38 arearrayed in the main scanning direction between the first drive roller22A and first follower roller 22B and the recording head 18 and platen21, and can protrude into the conveyance path P. The alignment mechanism28 aligns the orientation of the recording medium S by causing theleading end of the recording medium S to contact the alignment plates38.

As shown in FIG. 2, the printer assembly 11 has a plurality of alignmentsensors 39 that detect the presence of the recording medium S driven incontact with the alignment plates 38. The alignment sensors 39 aredisposed to the conveyance path P arrayed in the main scanning directionnear the upstream side of the alignment plates 38, and are transmissivesensors including a light-emitting unit (such as an LED) and aphotodetection unit (such as a phototransistor) disposed with theconveyance path P therebetween. Whether the skew of the recording mediumS to the conveyance direction after alignment by the alignment mechanism28 is within the allowable range can be determined from the number andpositions of the plural alignment sensors 39 that detect the leading endof the recording medium S.

The hybrid device 10 has a control circuit board (not shown in thefigure) located behind and below the main assembly 11, for example, as acontrol unit that controls hybrid device 10 operations, includingdriving the media conveyance motor 26, carriage 19 scanning, therecording operation of the recording wires of the recording head 18, andthe reading (scanning) operation of the optical reader 110.

The printer assembly 11 also has a plurality of media edge sensors 47that detect insertion of a recording medium S to the conveyance path Pin front of the first drive roller 22A. The media edge sensors 47 arereflective sensors having a light-emitting unit that emits light towardthe conveyance path P and a photodetection unit that detects thereflection of the emitted light, and detect the recording medium Sinserted from the manual insertion opening 15. Note that the media edgesensors 47 may alternatively be transmissive sensors having alight-emitting unit and a photodetection unit disposed with theconveyance path P therebetween. This configuration determines that arecording medium S was inserted to the conveyance path P when thephotodetection units of all insertion detection sensors 47 sense lightand then detection of light by any one of the insertion detectionsensors 47 is blocked.

As shown in FIG. 3, the main assembly 11 has an optical reader 110 thatreads text, symbols and images presented on the surface of the recordingmedium S. The optical reader 110 includes a first scanner module 111that reads information printed or otherwise presented on the top surfaceof the recording medium S, and a second scanner module 112 disposedopposite the first scanner module 111 that similarly reads informationprinted or otherwise presented on the bottom surface of the recordingmedium S. The recording medium S is normally inserted from the manualinsertion opening 15 so that the side on which the MICR information isprinted is on the bottom.

The first scanner module 111 and second scanner module 112 are opticalimage sensors that are disposed between the second drive roller 23A andthird drive roller 124A and continuously read information from therecording medium S conveyed through the conveyance path P.

The first scanner module 111 and second scanner module 112 may becontact image sensors (CIS), for example, and respectively have a flatglass plate 140, 150 that contacts the recording medium S, and a supportframe 141, 151 that supports the glass plate 140, 150. An emitter (notshown in the figure) that illuminates the reading area of the recordingmedium S with light output from an LED or other light source, aplurality of photosensors (not shown in the figure) arrayed in a singlerow in the main scanning direction (X axis), and an output unit (notshown in the figure) that outputs the signals from the photosensors tothe control circuit unit described above, are housed inside the supportframes 141, 151. The first scanner module 111 and second scanner module112 are not limited to CIS scanners, however, and CCD (charge coupleddevice) scanners may be used instead.

As shown in FIG. 2, the second scanner module 112 has a support frame151 and glass plate 150 extending lengthwise across the width of thehybrid device 10 parallel to the platen 21. The support frame 151 isdisposed so that the top surface of the glass plate 150 is exposed tothe conveyance path P through a window formed in the rear media guide25. The first scanner module 111 is disposed above the second scannermodule 112 as shown in FIG. 3 so that the bottom surface of the glassplate 140 is opposite the top of glass plate 150, and likewise extendsin the main scanning direction with substantially the same length as thesecond scanner module 112.

An urging member 113 is disposed above the first scanner module 111, andthe first scanner module 111 is urged toward the recording medium S onthe rear media guide 25 by the urging member 113. The urging member 113pushes the first scanner module 111 to the second scanner module 112with substantially uniform pressure across the width. A coil spring,flat spring, or elastomer cushion, for example, can be used as theurging member 113. A gap that accommodates recording media of a specificthickness is rendered between the surfaces of the glass plates 140, 150.When scanning a recording medium S, the first scanner module 111 ispushed up by the conveyed recording medium S and the urging member 113contracts, allowing the recording medium S to pass between the glassplates 140, 150. More specifically, the scanning quality of the opticalreader 110 is improved by the first scanner module 111 that is urged bythe urging member 113 pushing the recording medium S to the secondscanner module 112 side so that the recording medium S reliably contactsthe surfaces of the glass plates 140, 150.

The photosensors (not shown in the figure) of the first scanner module111 and second scanner module 112 are arrayed in a row in the mainscanning direction of the hybrid device 10, and scan lines extending inthe main scanning direction. The photosensors of the first scannermodule 111 and second scanner module 112 are disposed across a widerrange in the main scanning direction than the printing range of therecording head 18, and can scan a wider range than any recording mediumthat can be printed on by the hybrid device 10. The optical reader 110can therefore read the entire surface of any recording medium S that canbe used in the hybrid device 10.

The first scanner module 111 and second scanner module 112 are disposedon opposite sides of the conveyance path P as shown in FIG. 3, but thephotosensor line in the first scanner module 111 and the photosensorline in the second scanner module 112 are offset approximately 5 mm fromeach other in the conveyance direction of the recording medium S. Thisconfiguration eliminates the effect of light from one light source onthe other photosensor and results in higher scanning quality.

The first scanner module 111 and second scanner module 112 each have R,G, and B light sources, and can scan in both monochrome (binary, 16level, 256 level gray scale) and color modes. The scanning resolution ofthe first scanner module 111 and second scanner module 112 can be set toone of three levels, 200 dpi (dots/inch), 300 dpi, and 600 dpi. Thenumber of scan lines in the conveyance direction of the recording mediumS (the secondary scanning direction Y) is set according to the scanningresolution in the main scanning direction, and the conveyance speed ofthe recording medium S during scanning is adjusted according suchparameters as the scanning resolution and how fast the photosensoroutput signals can be processed.

FIG. 4 is a block diagram showing the control configuration of thehybrid device 10.

The parts shown in FIG. 4 can be rendered by the cooperation of hardwarecomponents disposed to the control circuit board (not shown in thefigure) and software.

The hybrid device 10 includes a CPU 40 as a control unit that controlsthe hybrid device 10 based on a control program, RAM 41 that temporarilystores data, flash-memory 42 that stores the control program executed bythe CPU 40 and processed data, a serial interface 43 and USB interface44 that convert the data format when communicating information with thehost computer 200 that controls the hybrid device 10, a gate array 45connected to various sensors, a motor driver 46 that drives motors, ahead driver 48 that drives heads, and a bus 49 to which these variousparts are connected.

RAM 41 functions as buffer memory, such as a receive buffer 66 (FIG. 5)the temporarily stores commands sent from the host computer 200, and animage buffer that temporarily stores image data captured by the opticalreader 110.

The alignment sensors 39, media edge sensors 47, media width sensor 55,first scanner module 111 and second scanner module 112 are connected tothe gate array 45. The gate array 45 quantizes the analog voltages inputfrom the alignment sensors 39, media edge sensors 47, and media widthsensor 55, and outputs the resulting digital data to the CPU 40. Thefirst scanner module 111 and second scanner module 112 optically readthe surface of the recording medium S using a CIS, supply the detectionvoltages from each pixel of the CIS to the gate array 45, and the gatearray 45 quantizes the analog voltages supplied from the first scannermodule 111 and second scanner module 112 and outputs the resultingdigital data to the CPU 40.

The magnetic head 34 is also connected to the gate array 45. The gatearray 45 outputs a read/write drive current to the magnetic head 34,detects the analog detection voltage of the magnetic head 34 whenreading magnetic data, and outputs the voltage as digital data to theCPU 40.

The motor driver 46 is connected to the media conveyance motor 26,carriage drive motor 56, magnetic head drive motor 57, and alignmentmotor 58, supplies drive current and drive pulses to the motors, andthus causes the motors to operate. Note also that an alignment motor 58(FIG. 4) for operating the alignment plate 38 (FIG. 3) may also beconnected to the motor driver 46.

The head driver 48 is connected to the recording head 18, and suppliesdrive current to the recording head 18 to drive the recording wires toprint.

The CPU 40 acquires detection signals from the sensors and drives themotors to convey the recording medium S by the gate array 45, motordriver 46, and head driver 48 based on a control program stored inflash-memory 42, and drives the heads to record on the recording mediumS.

The CPU 40 also conveys the recording medium S by the media conveyancemechanism 100, and reads the surface of the recording medium S by thegate array 45 and first scanner module 111 and second scanner module112. While scanning, the CPU 40 temporarily stores the data input fromthe gate array 45 sequentially to a buffer (not shown in the figure)rendered in RAM 41. The CPU 40 also reads and outputs the image datastored in the buffer (not shown in the figure) to the host computer 200through the serial interface 43 and USB interface 44.

The printing function, MICR function, MSR function, and optical scannerfunction described above are rendered by the control system of thehybrid device 10 shown in FIG. 4 controlling driving the parts of themain assembly 11 of the hybrid device 10 to operate according to thecommands sent from the host computer 200 as a result of the CPU 40executing a control program stored in flash memory 42.

FIG. 5 is a block diagram showing the functional configuration of thehybrid device 10 and host computer 200.

The host computer 200 renders the functional units shown in FIG. 5 as aresult of the CPU (not shown in the figure) executing programs. Morespecifically, the host computer 200 has an application program 201;various device drivers that render the application program 201 with ascanner driver 211, MICR driver 213, MSR driver 215, and printer driver217 that provide function modules for controlling the hybrid device 10;and a port handler 221 that assigns the input/output (I/O) ports of thehost computer 200 to the different device drivers. The host computer 200exchanges data and control signals with the hybrid device 10 through theUSB port 231, serial port 233, and parallel port 235.

The port handler 221 is achieved as a software construction rendered asa function of the operating system run by the CPU (not shown in thefigure) of the host computer 200.

The USB port 231 is rendered by a connector and USB host controllerconforming to the USB standard disposed on a hardware circuit board ofthe host computer 200, and corresponding logical I/O ports of theoperating system.

The serial port 233 is rendered by an RS-232C connector and controllerconforming to the RS-232C standard disposed on a hardware circuit board,and corresponding logical I/O ports of the operating system.

The parallel port 235 is rendered by a connector and parallel portcontroller conforming to the IEEE 1284 standard disposed on a hardwarecircuit board, and corresponding logical I/O ports of the operatingsystem.

The application program 201 is, for example, an application program forprocessing forms in financial institutions, and includes functions forprinting forms, processing checks, and processing passbooks. When thesefunctions are used, the application program 201 outputs requests to thedevice drivers of the scanner driver 211, MICR driver 213, MSR driver215, and printer driver 217, and processes data that is input inresponse to these requests. The hybrid device 10 executes actionsincluding printing on passbooks, printing on checks, reading MICR textfrom checks, reading magnetic stripes on passbooks, and scanning bothsides of checks.

The devices drivers of the scanner driver 211, MICR driver 213, MSRdriver 215, and printer driver 217 manage hybrid device 10 operation bygenerating and outputting commands for executing the requests outputfrom the application program 201 to the port handler 221, and acquiringdata sent from the hybrid device 10 in response to the commands.

The hybrid device 10 accordingly has a receive buffer 66 for temporarilystoring commands and data sent from the host computer 200 through theserial interface 43 and USB interface 44. The hybrid device 10 can beconnected to the host computer 200 through either or both the serialinterface 43 and USB interface 44, and stores all commands and datareceived through the serial interface 43 and USB interface 44 to thereceive buffer 66.

The hybrid device 10 also has a control unit 70 that executes commandsstored in the receive buffer 66. This control unit 70 is rendered by theCPU 40 (FIG. 4) running a control program.

The control unit 70 can switch the operating mode between a printercontrol mode 71, printer emulation control mode 72, scanner control mode(emulation) 75, MICR control mode 76, and MSR control mode 77.

The printer control mode 71 and printer emulation control mode 72 areoperating modes for printing on checks or passbooks used as therecording medium S in which the gate array 45, motor driver 46, and headdriver 48 shown in FIG. 4 drive the media conveyance motor 26, carriagedrive motor 56, alignment motor 58, and recording head 18 based on thedetected values output by the alignment sensors 39, media edge sensors47, and media width sensor 55. As a result, the printer control modes71, 72 convey and align (position) the recording medium S as needed, andprint text, symbols, or other markings on the recording medium S.

The scanner control mode 75 is an operating mode for optically readingthe recording medium S by the optical reader 110. The scanner controlmode 75 controls the gate array 45 and motor driver 46, drives the mediaconveyance motor 26 and conveys the recording medium S as required basedon the output detection signals from the media edge sensors 47 and mediawidth sensor 55, and captures the data output by the first scannermodule 111 and second scanner module 112.

The MICR control mode 76 is the operating mode for reading magnetic inkcharacters recorded on the recording medium S. The MICR control mode 76controls the gate array 45, motor driver 46, and head driver 48, drivesthe media conveyance motor 26, magnetic head drive motor 57, andmagnetic head 34 based on the output detection signals from the mediaedge sensors 47 and media width sensor 55, and acquires and interpretsthe output detection values from the magnetic head 34.

The MSR control mode 77 is an operating mode for reading and writinginformation recorded in the magnetic stripe of the recording medium S.The MSR control mode 77 controls the gate array 45, motor driver 46, andhead driver 48, drives the media conveyance motor 26, magnetic headdrive motor 57, and magnetic head 34, and conveys the recording medium Sas needed based on the output detection signals from the media edgesensors 47 and media width sensor 55 to acquire the output values fromthe magnetic head 34 and read the magnetic stripe or write informationto the magnetic stripe.

Commands sent from the host computer 200 to the hybrid device 10 arecommands defined by a specific command system. The scanner driver 211,MICR driver 213, 315, and printer driver 217 of the host computer 200are compatible with the specific command systems, and send commandsdefined by the appropriate command systems to the hybrid device 10. Forexample, the scanner driver 211 has an API that conforms to the TWAINspecification, and sends scanner control commands to the hybrid device10.

The operating modes of the control unit 70 of the hybrid device 10correspond to these different command systems (command groups). Forexample, the printer control mode 71 is compatible with command systemV, and the printer emulation control mode 72 is compatible with commandsystem W. There are plural printer control modes that cause the hybriddevice 10 to operate as a printer and print so that the operation ofother printers can be emulated. These plural command systems and thecommands used in each command system are stored in a storage unit (notshown in the figure) of the control unit 70.

More specifically, the printer emulation control mode 72 is an operatingmode for operating according to the commands of the command system(command system W) that is provided for a printer (printer W in thisexample) other than the hybrid device 10. When a hybrid device 10replaces a printer W in a system that uses printer W connected to thehost computer 200, the printer driver 217 on the host computer 200 mustusually be replaced with a printer driver for the hybrid device 10.However, the hybrid device 10 has a printer emulation control mode 72that emulates the operation of printer W and causes the hybrid device 10to operate according to the same commands applied to printer W. Byimplementing the printer emulation control mode 72, the host computer200 can continue using the printer driver 217 for printer W, therebyavoiding the work involved with installing a new device driver andavoiding problems on the host computer 200 resulting from replacing thedevice driver.

In addition to the printer control mode 71, which is its nativeoperating mode, the hybrid device 10 according to this embodiment of theinvention has a printer emulation control mode 72 for emulating printerW, but numerous printer control modes can obviously be provided in thehybrid device 10 so that a greater number of devices can be emulated.The command system W of this printer control mode 72 is a commandemulation system (a second command system, a command system foremulating a another electronic device, a command system for a secondprocess unit), and the command system V of the printer control mode 71is the command system of the native operating mode (a first commandsystem, the original (native) command system of the electronic device,the command system of a first process unit).

The control mode 75, MICR control mode 76 and MSR control mode 77 arecompatible with command systems appropriate to their respectivefunctions. For example, the scanner control mode 75 and MICR controlmode 76 are compatible with command systems L and M. The command systemsL, M, N of the scanner control mode 75, MICR control mode 76 and MSRcontrol mode 77 may be identical to or inclusive of the command systemsused by the scanner driver 211, MICR driver 213, and MSR driver 215 ofthe host computer 200, and the specific command system can be configuredas desired. For example, the hybrid device 10 may be controlled by aproprietary command system, by an industry-standard command system, orby a command system that emulates a different model. These commandsystems and the commands of the other command systems are stored in astorage unit (not shown in the figures).

The control unit 70 of the hybrid device 10 interprets and executescommands sent from the host computer 200 and stored in the receivebuffer 66 in the order received, for example. The control unit 70 alwaysoperates in one of the printer control modes 71, 72, scanner controlmode 75, MICR control mode 76, or MSR control mode 77, and is always inone of these operating modes. This is because received commands cannotbe interpreted and executed if the control unit 70 is not able tooperate according to one of these command systems.

The hybrid device 10 according to this embodiment of the inventionoperates in the printer control mode 71 as its normal (default)operating mode. The command system V of the printer control mode 71includes a command (switching command) for switching to a differentoperating mode, and when this command is received, the control unit 70can switch from the printer control mode 71 to the printer emulationcontrol mode 72, scanner control mode 75, MICR control mode 76, and MSRcontrol mode 77. A command contained in the command systems W, L, M, Nof the printer control mode 72, scanner control mode 75, MICR controlmode 76 and MSR control mode 77 is also defined in the command system ofthe printer control mode 71, and when this command is received, controlchanges to the corresponding operating mode and the commands can beexecuted. For example, a start scanning command that is required forscanner control is contained in the command system V of the printercontrol mode 71. As a result, when the start scanning command for thescanner is received after the hybrid device 10 operates as a printer inthe printer control mode 71, the printer control mode 71 changes to thescanner control mode 75, and the optical reader 110 starts scanning.

The command system V of the printer control mode 71 is a switchingcommand system that is compatible with a switching command to change toa different command system. The command system W of the printeremulation control mode 72 is a non-switching command system that is notcompatible with a switching command for changing to a different commandsystem.

FIG. 6 is a flow chart showing an example of the operation of the hybriddevice 10.

The operation described by example in FIG. 6 is the operation performedto read the MICR line of the check, optically scan both sides of thecheck, print, and then discharge the check when a check has beeninserted as the recording medium S from the manual insertion opening 15.

The control unit 70 of the hybrid device 10 starts up in the printercontrol mode 71, which is set as the default in a storage unit. When thecontrol unit 70 detects based on output from the media edge sensors 47that a check was inserted to the manual insertion opening 15 (step S11),it executes an alignment operation that controls the motor driver 46 tooperate the alignment motor 58 and advance the alignment plate 38 intothe conveyance path P while operating the media conveyance motor 26 toalign the orientation of the check (step S12). The control unit 70acquires the output values of the alignment sensors 39 from the gatearray 45, and ends the alignment operation by operating the alignmentmotor 58 and retracting the alignment plate 38 after determining thatthe check is properly aligned.

If the host computer 200 has asserted an MICR read command (step S13),the control unit 70 receives this command, changes the operating mode tothe MICR control mode 76, and executes the command. More specifically,the control unit 70 controls the motor driver 46 to operate the mediaconveyance motor 26 and convey the check from the alignment position tothe width detection position (step S14), and detects the width of thecheck by driving the carriage drive motor 56 and monitoring output fromthe media width sensor 55 during this operation (step S15).

The control unit 70 then controls the motor driver 46 to operate themedia conveyance motor 26 and convey the check to the MICR readingposition (step S16), drives the magnetic head drive motor 57 to scan thecheck with the magnetic head 34, and acquires the output values from themagnetic head 34 (step S17). The control unit 70 identifies the MICRcharacters by analyzing the acquired output values of the magnetic head34 (step S18), and ends the MICR line reading operation.

When a scan command is then sent from the host computer 200 (step S19),the control unit 70 reads this command stored in the receive buffer 66,switches the operating mode to the scanner control mode 75, and executesthe command. More specifically, the control unit 70 controls the motordriver 46 and operates the media conveyance motor 26 to convey the checkto the scanning start position (step S20). The control unit 70 thenoperates the media conveyance motor 26, acquires the output data fromthe first scanner module 111 and second scanner module 112 through thegate array 45, and scans the check (step S21). The control unit 70 theninterprets the output data from the first scanner module 111 and secondscanner module 112 to capture images of both sides of the check whilealso performing an OCR (optical character recognition) operation (stepS22).

When a command specifying the start printing position is sent from thehost computer 200 (step S23), the control unit 70 reads the commandstored in the receive buffer 66, switches the operating mode to theprinter control mode 71 or printer emulation control mode 72, andexecutes the command. More specifically, the control unit 70 controlsthe motor driver 46 to drive the media conveyance motor 26 and conveythe check to the start printing position (step S24). When a printcommand and line feed command are sent from the host computer 200, thecontrol unit 70 executes the commands to drive the media conveyancemotor 26 and carriage drive motor 56 and control the head driver 48 toprint by the recording head 18 and advance the check after finishingprinting each line (step S26). When this printing sequence ends, thecontrol unit 70 drives the media conveyance motor 26 and conveys thecheck to the stop printing position (step S28).

When a discharge command is sent from the host computer 200 (step S28),the control unit 70 receives and executes the command to drive the mediaconveyance motor 26 and discharge the check from the manual insertionopening 15 or paper exit 20 (step S29). The control unit 70 then returnsto the standby mode to wait for recording medium S insertion (step S30),and this process ends.

As described above, the control unit 70 switches to the operating mode(command system) corresponding to the command sent from the hostcomputer 200, executes the command, and implements the correspondingprinter function, scanner function, MICR function, or MSR function.

In this embodiment, the printer emulation control mode 72 uses a commandsystem W for a printer W of a different model. If printer W does notsupport switching to another command system, it cannot issue a commandfor switching to another command system to a hybrid device 10 that isoperating in the printer emulation control mode 72. The hybrid device 10can therefore not switch from the printer emulation control mode 72 toanother operating mode. In this case, the operator turns the hybriddevice 10 off and then restarts to switch to the printer control mode71, which is the basic operating mode set as the default in a storageunit, or resets the hybrid device 10 by asserting a reset command if areset command is defined in the command system W of the printeremulation control mode 72, and then restarts from the default printercontrol mode 71 set in the storage unit.

Because the reset command includes completely deleting all commands anddata temporarily stored in the receive buffer 66, the timing when it canbe executed is limited. It is therefore difficult to adapt when use of acommand system that does not have a command defined for changing toanother command system has ended. Expanding the command system W used inthe printer emulation control mode 72 to include a command for switchingto another command system is also futile if the printer driver 217 ofthe host computer 200 does not have a corresponding command becauseswitching to another command system will not be possible.

The hybrid device 10 according to this embodiment of the inventiontherefore also has a function for switching to the printer control mode71 when specific reset conditions (switching conditions) are satisfiedafter entering the printer emulation control mode 72. This function setsreset conditions when the printer emulation control mode 72 is entered,and when these reset conditions are satisfied, the operating modechanges to the printer control mode 71 (the native operating mode) or tothe operating mode that was active before entering the printer emulationcontrol mode 72. This solves the problem of being unable to change to adifferent operating mode due to a functional limitation of the commandsystem W used in the printer emulation control mode 72.

This function is described below.

FIG. 7 is a flow chart showing the operation when changing the operatingmode of the hybrid device 10.

FIG. 7 shows the operation of the control unit 70 related to changingthe operating mode. The control unit 70 functions as a command controlunit and a transition condition setting unit when executing theoperation shown in FIG. 7.

When the hybrid device 10 power turns on, the control unit 70 startsoperating in the default operating mode preset in the storage unit(first command system, default (native) command system of the electronicdevice, command system of a first process unit) (step S41). The defaultoperating mode is compatible with a multifunction command systemincluding a command for instructing a change to another operating mode.In this embodiment of the invention, the default (native) operating modeis set to the printer control mode 71.

The control unit 70 determines if there is a command in the receivebuffer 66 that has been received but still not executed (step S42),waits until a command is received if an unexecuted command is not in thereceive buffer 66 (step S43), and interprets the received command when acommand is received from the host computer 200 (step S44). If there is acommand that has not been executed (step S42 returns Yes), the controlunit 70 interprets the commands in the receive buffer 66 in the orderreceived (step S44).

The control unit 70 interprets the command in step S44, and determinesif it is a command contained in the current command system, that is, inthe command system V of the printer control mode 71, or is a commandbelonging to another command system (step S45). If the command is not acommand for the current command system (step S45 returns No), thecontrol unit 70 determines if the interpreted command is contained inthe command system of a device emulation operating mode (step S46). Ifthe command system containing the interpreted command is a commandsystem for an operating mode other than an emulated command system (stepS46 returns No), the control unit 70 switches to the operating modecontrolled by the command system corresponding to that other operatingmode (step S47), and executes the command (step S48).

When executing the command is completed, the control unit 70 returns tostep S42. If the interpreted command is a command in the current commandsystem (step S45 returns Yes), the control unit 70 goes to step S48 andexecutes the command.

When the control unit 70 interprets the command in step S44 and detectsa switching command, the command is contained in the command system ofthe printer control mode 71 but the control unit 70 returns No in stepS45 as an exception. The control unit 70 then determines if the commandsystem that is identified by the switching command when the commandsystem to be selected is contained (identified) in the switchingcommand, or if the command system that is set in the storage unit whenthe command system to be selected is not contained in the switchingcommand, is the command system of an operating mode to be emulated (stepS46), and continues processing according to the specified commandsystem. The command system that is switched to can be preset in thestorage unit by the control unit 70 receiving a configuration commandand storing the command system specified by the configuration command asthe command system to be selected.

If the interpreted command is a command belonging to a command emulationsystem (step S46 returns Yes), the control unit 70 sets the resetconditions contained in the command. Alternatively, if the interpretedcommand is a command of an emulated command system (step S46 returnsYes), the control unit 70 sets the reset conditions contained in thecommand. Alternatively, if the received command is a switching commandand reset conditions (state transition conditions) are contained in thatswitching command, those reset conditions are set; if reset conditionsare not contained, the reset conditions stored in the storage unit areread and set. A command for setting the reset conditions could also bereceived, and the control unit 70 could set the reset conditionsspecified in the configuration command in the storage unit.

Examples of these reset conditions include, for example, passage of aspecified time after switching the operating mode (command system) to anemulation mode; finishing executing all commands in the emulated commandsystem received from the host computer 200; finishing executing allcommands stored in the receive buffer 66; finishing executing a singleinterpreted command; executing a specific command; and the receivebuffer 66 becoming empty. Examples of a specific command include a linefeed command, a form feed command, a page feed command, a paperdischarge command, or other command denoting a break in operation whenthe hybrid device 10 is in the printer emulation control mode 72operating as a printer, and there is preferably no adverse effect onprint quality if the hybrid device 10 pauses operation after executingthe specific command.

After the reset conditions are set or read, the control unit 70 switchesto the emulation operating mode (second command system, command systemfor emulating the command system of another electronic device, commandsystem of a second process unit) (in this example, the printer emulationcontrol mode 72) (step S50), and executes the interpreted command or thecommand of the command system for the emulation operating mode receivedfrom the host computer 200 (step S51).

After executing the interpreted command, the control unit 70 determineswhile in the emulation operating mode whether or not the reset conditionis satisfied (step S52), and if the reset condition is not satisfied(step S52 returns No), determines if there is a command that has notbeen executed in the receive buffer 66 (step S53). If there is anunexecuted command, the control unit 70 goes to step S51 and executesthe command. If there is not an unexecuted command, the control unit 70returns to step S52 and determines if the reset condition is satisfied.

If the reset condition is satisfied (step S52 returns Yes), the controlunit 70 resumes the operating mode in use before entering the emulatedoperating mode (that is, the original operating mode, the printercontrol mode 71 in this example) (step S54). When hybrid device 10operation stops (step S55 returns Yes), this process ends. If hybriddevice 10 operation does not end, control returns to step S42. The resetcondition of the command system can be constructed as a reset symbol andargument contained in the switching command. For example, the switchingcommand could be “ESC C:W R:V S:1” where ESC denotes a command incommand system V, and C:W R:V S:1 are arguments where C (change) denoteschanging to command system W, R (return) denotes returning to commandsystem V; and S (stipulation) denotes the reset condition. In thisexample, control switches from command system V to command system W, aspecific operation is performed according to the command received fromthe host computer 200 in command system W, and when the reset conditionis satisfied, control returns to command system V. In addition, 1 is anargument indicating completion of one command, other numerals denoteother arguments, and other reset conditions and combinations ofarguments are also possible. When this switching command is received,the control unit 70 changes the command system, stores the resetcondition in RAM 41 or flash memory 42, monitors the processing stateand the defined reset conditions, and changes to the specified commandsystem when the reset condition is satisfied.

As described above, a hybrid device 10 according to a preferredembodiment of the invention has a control unit 70 that switches betweena plurality of command systems (operating modes) according to switchingcommands sent from a host computer 200, and after changing the commandsystem sets specific reset conditions (transition conditions) forswitching to yet another command system. When the set reset condition issatisfied, the control unit 70 reverts to the previous operating mode orchanges to another operating mode. As a result, the hybrid device 10 canswitch to a different operating mode even if it is using an operatingmode (such as the printer emulation control mode 72) that does not havea command defined for switching to a different operating mode. Afunction for changing to another operating mode can therefore besustained regardless of the specifications of the operating mode beingused.

The reset condition is contained in the switching command sent from thehost computer 200, and the control unit 70 sets the reset commandcontained in the switching command received from the host computer 200.It is therefore possible to change the command system of the hybriddevice 10 and to set the transition conditions used after the commandsystem is changed by a single switching command sent from the hostcomputer 200. The hybrid device 10 can therefore be easily configured toautomatically return to the original command system after changing to aspecific command system and completing a specified operation withoutreceiving another switching command from the host computer 200.

Based on commands sent from the host computer 200, the control unit 70can also switch between a plurality of operating modes including aprinter control mode 71 that is the normal (default) operating mode, ascanner control mode 75, a MICR control mode 76, a MSR control mode 77,and a printer emulation control mode 72, which is an emulated operatingmode corresponding to a command emulation system for emulating anoperating mode of another device. The printer emulation control mode 72is a non-switching operating mode that does not have a command forchanging to another operating mode.

More specifically, the control unit 70 is compatible with and can switchbetween a plurality of command systems including command system V, whichis the command system of the normal operating mode, and command systemW, which is a command system for emulating another device. When the setreset condition is satisfied after switching from command system V(printer control mode 71) to command system W (printer control mode 72),the control unit 70 changes from the printer emulation control mode 72corresponding to command system W back to the printer control mode 71corresponding to command system V.

It is therefore possible to change to a command system W that emulatesanother device (printer W in this example) and then return to commandsystem V, which was the command system before the command system waschanged, when the reset condition is satisfied even if a switchingcommand for changing to another command system is not defined in thecommand system W for emulating the other device. It is thereforepossible to switch to an advanced command system with greatfunctionality after using a command system with limited functionalityeven when a command system with limited functionality must be used inorder to emulate the operation of older devices with limitedfunctionality, for example. Different types of devices can therefore beproperly emulated while assuring user convenience.

The operating modes that the control unit 70 can switch between includea printer control mode 71 using command system V, which is a switchingcommand system compatible with a switching command, and a printeremulation control mode 72 compatible with command system W, which is anon-switching command system that is not compatible with a switchingcommand, and a condition enabling the control unit 70 to switch from theprinter emulation control mode 72 to the printer control mode 71 is setas the reset condition. As a result, when changing from a switchingcommand system compatible with a switching command used by the hybriddevice 10 to a non-switching command system that does not have a commandto instruct changing to another command system, the hybrid device 10 canset transition conditions and switch to the other command system whenthe transition conditions are satisfied even though a device accordingto the related art cannot change from a non-switching command system toanother command system. A function for changing to another commandsystem can therefore be rendered regardless of the specifications of thecommand system used.

The hybrid device 10 also sets as a reset condition at least one of thefollowing: passage of a specified time after switching the commandsystem; finishing executing all commands received from the host computer200; and finishing executing a single command received from the hostcomputer 200. As a result, a function for changing to another commandsystem can be reliably maintained regardless of the specifications ofthe command system. Other reset conditions, that is, opportunities forchanging to a different command system, include the receive buffer thatstores received commands becoming empty, and when the print unit of thehybrid device 10 executes a line feed or page feed operation.

The hybrid device 10 also has a recording head 18, carriage 19, carriagedrive motor 56, media conveyance motor 26, and motor driver 46 as aprint unit that prints on the processed medium according to commandssent from the host computer 200, and an optical reader 110 thatoptically reads the processed medium according to commands sent from thehost computer 200. The control unit 70 determines if commands sent fromthe host computer 200 are commands for the print unit or commands forthe optical reader 110, switches to a printer control mode 71, 72, ifthe command is for the print unit, and switches to the scanner controlmode 75, which is the operating mode for controlling the optical reader110, if the command is for the optical reader 110. As a result, a hybriddevice 10 that has a print unit and an optical reader can switch betweenand execute different operating modes according to the selected functionbecause the commands that are used are changed according to the deviceaddressed by the commands sent from the host computer 200.

A preferred embodiment of the invention is described above, but theinvention is not limited thereto. For example, the control unit 70returns (step S54) to the previous operating mode in this embodiment ofthe invention when the reset condition is satisfied in the operationshown in FIG. 7, but the invention is not so limited and the controlunit 70 could go to a different operating mode. For example, when theprinter control mode 71 is set as the default operating mode asdescribed above, control could always return to the printer control mode71 regardless of which operating mode is used when the specified resetcondition is satisfied.

In addition, an emulation operating mode and an operating mode that isswitched to from the emulation mode could be separately defined so thatcontrol goes to the scanner control mode 75 when the reset condition issatisfied while in the printer emulation control mode 72. This settingcould be configured with the reset condition. The reset condition couldalso be defined on the fly. Further alternatively in a configurationthat always uses a single reset condition previously stored in flashmemory 42, the reset condition can be selected in step S49 from among aplurality of reset conditions stored in flash memory 42 according to thetype of operating mode emulated, the type of operating mode used beforethe change, or the type of recording medium S being processed, forexample.

The control unit 70 could also monitor whether or not the resetcondition is satisfied either at a specific time interval or constantlyduring operation in the emulation mode. In this configuration, theoperating mode could be changed when the reset condition is met, or whenexecuting the command is completed.

The control unit mounted on the control circuit board (not shown in thefigure) installed in the hybrid device 10 is described in the foregoingembodiment as having the functions of the function blocks shown in FIG.4 and FIG. 5, and controlling other units of the hybrid device 10, but adevice externally connected to the hybrid device 10 could function aspart or all of the function units shown in FIG. 4 and control the hybriddevice 10. In addition, the function blocks shown in FIG. 4 and FIG. 5are achieved by cooperation between hardware and software, but thespecifics of the hardware and software configurations can be determinedas desired, and other detailed aspects of the configuration can bechanged as desired.

The foregoing embodiment describes a hybrid device 10 having a SIDMrecording head 18, magnetic head 34, and optical reader 110, but theinvention is not so limited and can obviously be adapted to otherconfigurations having an optical reading unit equivalent to the opticalreader 110 disposed to an inkjet printer, thermal printer, or laserprinter, for example. The invention is also not limited to stand-alonedevices, and the invention can obviously be adapted to devices that areincorporated into another device such as an ATM (automated tellermachine) or cash dispenser.

A program that implements the steps of switching the operating mode ofthe hybrid device 10 shown in FIG. 7 and is stored in a storage unit orstorage medium in the hybrid device 10, or a storage medium external tothe hybrid device 10, can also be read and executed by the control unit70.

Although the present invention has been described in connection with thepreferred embodiments thereof with reference to the accompanyingdrawings, various changes and modifications will be apparent to thoseskilled in the art in light of this disclosure. Any and all such changesor modifications are considered to be within the scope of the presentinvention to the extent encompassed by any of the following claims.

What is claimed is:
 1. An electronic device configured to communicatewith a host computer, the electronic device comprising: a storage thatstores at least a first command system and a second command system, thefirst command system including a first group of commands to operate afirst control mode and the second command system including a secondgroup of commands to operate a second control mode; a receive bufferconfigured to receive from said host computer at least onemode-switching-condition selection that specifies at least oneswitch-triggering condition, said switch-triggering condition being anoperation condition achievable by said electronic device in said secondcontrol mode; a transition condition configuration element that, inresponse to an instruction to switch to said second command system,configures the monitoring of operation of said electronic device forsaid switch-triggering condition; and a command controller that, inresponse to said instruction to switch to said second command system,switches the operation of said electronic device to said second commandsystem and then automatically switches back from the second commandsystem to the first command system when the switch-triggering conditionis satisfied.
 2. The electronic device described in claim 1, wherein:the instruction to switch to said second command system is part of acontrol-mode switching command available in said first command system;and the second command system lacks any control-mode switching command.3. The electronic device described in claim 2, wherein themode-switching-condition is contained in the control-mode switchingcommand.
 4. The electronic device described in claim 2, wherein thestorage stores a third command system including a third group ofcommands to operate a third control mode, and a switching condition forchanging operation by the controller from the third command system tothe second command system or vice versa is defined within thecontrol-mode switching command.
 5. The electronic device described inclaim 1, wherein the first control mode is a native control mode of theelectronic device, and the second control mode is an emulation controlmode that emulates a native control mode of a foreign electronic devicedifferent from said electronic device.
 6. The electronic devicedescribed in claim 1, wherein: the first group of commands is defined bya first command language, and the second group of commands is defined bya second command language different from the first command language; thecommand controller determines if a command received from the hostcomputer is from said first command language or from said second commandlanguage; recognizes said instruction to switch to said second commandsystem if a command from said second command language is received whilein said first command system; and recognizes an instruction to switch tosaid first command system if a command from the first command languageis received while in said second command system.
 7. The electronicdevice described in claim 6, further comprising: a print head assemblythat prints on a processed medium; and an optical reader that opticallyreads the processed medium; wherein the first command system is either acommand system for controlling the print head assembly or a commandsystem for controlling the optical reader, and wherein the secondcommand system is the other of the command system for controlling theprint head assembly and the command system for controlling the opticalreader.
 8. The electronic device described in claim 1, wherein said atleast one mode-switching-condition selection is freely selected fromamong a plurality of predefined operation conditions.
 9. The electronicdevice described in claim 8, wherein plurality of available switchingconditions includes the passage of a specific time period in the secondcommand system, the completing of execution of all commands currentlyreceived from the host computer, the completing of execution of aspecific command received from the host computer, and the reception of apre-defined command within the second group of commands that is not acontrol-mode switching command.
 10. The electronic device described inclaim 1, wherein said electronic device is a single printer.
 11. Acontrol method for an electronic device configured to communicate with ahost computer, and store at a plurality of command systems, the methodcomprising steps of: responding to reception of a specific command fromthe host computer that is interpreted to include an instruction forswitching from a current command system to a target command system bychanging operation of the electric device to said target command system;if the specific command specifies a transition condition for switchingout of the target command system, then setting the monitoring of theelectronic device for the transition condition specified in the specificcommand; and responding to the transition condition being monitoredbecoming satisfied by automatically changing operation of the electronicdevice from the target command system to another command system; whereineach of said command systems includes a respective, unique commandlanguage.
 12. The electronic device control method described in claim11, wherein: the command language of the current command system includesa switching command for switching out of a command system; and thecommand language of the target command system lacks any switchingcommand from switching out of a command system.
 13. The electronicdevice control method described in claim 11, wherein the another commandsystem is specified in said specific command, and the another commandsystem is different from said current command system.
 14. The electronicdevice control method described in claim 11, wherein: the electronicdevice further stores a default transition condition; the specificcommand includes a data field for specifying a desired transitioncondition for switching out of the target command system; and if thespecific command does not specify any transition condition for switchingout of the target command system, then setting monitoring of theelectronic he default transition condition.
 15. The electronic devicecontrol method described in claim 11, wherein the current command systemis a native command system of the electronic device, and the targetcommand system is an emulation command system that emulates a nativecommand system of foreign electronic device.
 16. The electronic devicecontrol method described in claim 11, wherein: the electronic devicedetermines the command language to which a command received from thehost computer belongs; and interprets said specific command to includesaid instruction for switching from said current command system to saidtarget command system if said specific command is a command from thecommand language of the target command system and said specific commandis received while said electronic device is in said current commandsystem.
 17. The electronic device control method described in claim 16,wherein the electronic device also includes a print head assembly thatprints on a processed medium, an optical reader that optically reads theprocessed medium; the current command system is either a command systemfor controlling the print head assembly or a command system forcontrolling the optical reader, and the target command system is theother of the command system for controlling the print head assembly andthe command system for controlling the optical reader.
 18. Theelectronic device control method described in claim 11, wherein thetransition condition is at least one of: the passage of a specific timeafter changing to the target command system, finishing executing allcommands currently received from the host computer, finishing executingone command received from the host computer, and reception of apre-defined command within the second group of commands that is not acontrol-mode switching command.
 19. A non-transitory storage medium thatstores a program for execution by a controller to execute the controlmethod of claim
 11. 20. The electronic device described in claim 15,wherein the electronic device is native printer, the native commandsystem defines native printer functions of the native printer, and theemulation command system emulates a second printer using printerfunctions foreign to the native printer.